﻿using System;
using Autodesk.Revit.DB;

namespace YJKSparseDisOfDoor.ModelLayer
{
	public class DoorSchema
	{
		public ElementId StartDoorId { get; set; }

		public ElementId EndDoorId { get; set; }

		public double Distance { get; set; }

		public string ThisValue { get; set; }

		public DoorSchema()
		{
		}

		public DoorSchema(ElementId startDoorId, ElementId endDoorId, double dis)
		{
			this.StartDoorId = startDoorId;
			this.EndDoorId = endDoorId;
			this.Distance = dis;
			this.ThisValue = string.Concat(new object[]
			{
				this.StartDoorId.IntegerValue.ToString(),
				";",
				this.EndDoorId.IntegerValue.ToString(),
				";",
				this.Distance
			});
		}

		public override bool Equals(object obj)
		{
			DoorSchema doorSchema = obj as DoorSchema;
			return doorSchema != null && this.ThisValue == doorSchema.ThisValue;
		}

		public override int GetHashCode()
		{
			return base.GetHashCode();
		}
	}
}
